//定义数组
const socres = [90, 85, 95, 78, 88]
let total = 0

//使用for循环算出总分
for (let i = 0; i < socres.length; i++) {
    total += socres[i]
}
const average = total / socres.length
console.log(average)

let shopping = ["bread", "milk", "cheese", "hummus", "noodles"]
let ramdom = ["bread", "milk", 18, 20]

console.log('shopping:', shopping)
console.log('ramdom', ramdom)
//将数组转换成字符串，并用 - 连接起来
console.log(shopping.join("-"))
//找到 milk 所在的位置，从0开始
console.log(shopping.indexOf("milk"))

//给 shopping 数组添加 apple 
shopping.push("apple")

//把另外一个数组合并到 shopping
console.log(shopping.concat(["apple", "orange"]))
console.log(shopping)